package com.xblog.chatbox.vlmp.core.message;

import com.xblog.chatbox.vlmp.conversation.Conversation;
import com.xblog.chatbox.vlmp.conversation.ConversationPayloadFeedbacks;
import com.xblog.chatbox.vlmp.conversation.ConversationRequest;
import com.xblog.chatbox.vlmp.conversation.ConversationResponse;
import com.xiaowu.xblog.constant.UserContext;
import org.springframework.core.Ordered;
import reactor.core.publisher.Flux;


/**
 * @description:
 * @author: xiaowu
 * @time: 2025/8/6 22:44
 */
public interface VlmpAgentMessageProvider extends Ordered {

    @Override
    default  int getOrder(){
        return Integer.MIN_VALUE;
    }


    /**
     * 订阅主题,主题以/分割,如: /device/TS-01/09012/message 支持通配符 /device/**
     *
     * @return 订阅主题
     */
    String getTopic();

    /**
     * 订阅
     *
     * @param userContext 登录信息
     * @param request       请求信息
     * @return 消息流
     */
    Flux<ConversationResponse> subscribe(UserContext userContext, ConversationRequest request);


    /**
     * 删除会话信息
     *
     * @param context 登录信息
     * @param conversation  会话信息
     */
    void delete(UserContext context, Conversation conversation);

    /**
     * 重名名会话信息
     *
     * @param context 登录信息
     * @param conversation  会话信息
     */
    void rename(UserContext context, Conversation conversation);

    /**
     * 提交反馈
     *
     * @param feedbacks 反馈信息
     */
    void feedbacks(UserContext context, ConversationPayloadFeedbacks feedbacks);
}
